//
//  HMPlayingViewController.m
//  MusicPlayer
//
//  Created by 王龙飞 on 15/9/29.
//  Copyright © 2015年 王龙飞. All rights reserved.
//

#import "HMPlayingViewController.h"
#import "UIView+Frame.h"
@interface HMPlayingViewController ()

- (IBAction)exit;
@end

@implementation HMPlayingViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

- (void)show
{
    UIWindow *window = [UIApplication sharedApplication].keyWindow;
    
    self.view.frame = window.bounds;
    
    [window addSubview:self.view];
    
    window.userInteractionEnabled = NO;
    
    //设置界面的动画效果
    self.view.y = self.view.height;
    
    [UIView animateWithDuration:1.0 animations:^{
        
         self.view.y = 0;
    } completion:^(BOOL finished) {
        
        window.userInteractionEnabled = YES;
    }];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (IBAction)exit {
    
    UIWindow *window = [UIApplication sharedApplication].keyWindow;
    window.userInteractionEnabled = NO;
    [UIView animateWithDuration:1.0 animations:^{
        
        self.view.y = self.view.height;
    } completion:^(BOOL finished) {
        
        window.userInteractionEnabled = YES;
    }];

}
@end
